package cn.z2huo.knowledge.basic.exception.throwskeyword;

/**
 * <p>
 *
 * @author z2huo
 */
class UnCheckedExceptionThrowsTest {

    public void test2() throws RuntimeException {
        throw new RuntimeException();
    }

    public void test() {
        throw new RuntimeException();
    }

    public static void main(String[] args) {
        UnCheckedExceptionThrowsTest test = new UnCheckedExceptionThrowsTest();
        try {
            test.test();
        } catch (Exception e) {
            e.printStackTrace();
        }
        // 这里不用 err，则输出内容跑不到 两个 printStackTrace 中间
        System.err.println("-------------------------");
        try {
            test.test2();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
